package com.android.youwenchuang.ui.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.android.youwenchuang.R;
import com.android.youwenchuang.bean.News;
import com.blankj.utilcode.constant.TimeConstants;
import com.blankj.utilcode.util.TimeUtils;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

public class XueTangAdapter extends BaseQuickAdapter<News, BaseViewHolder> {
    public XueTangAdapter() {
        super(R.layout.item_xuetang);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, News item) {
        baseViewHolder.setText(R.id.tv_title, item.getTitle());
        baseViewHolder.setText(R.id.tv_time, TimeUtils.getString(item.getDate(),0, TimeConstants.MSEC));
        ImageView ivImage = baseViewHolder.getView(R.id.iv_image);
        Glide.with(getContext())
                .load(item.getPics())
                .into(ivImage);
    }
}
